package com.airclick.merchant.entity;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;


@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name="t_ums_admin", schema = "game")
@org.hibernate.annotations.Table(appliesTo = "t_ums_admin", comment = "用户表")
@ApiModel("MerDomain(用户表)")
public class MerDomain extends BaseEntity {

    @Id
    @ApiModelProperty("主键编号")
    @GeneratedValue(generator = "snowFlakeIdGenerator", strategy = GenerationType.SEQUENCE)
    @GenericGenerator(name = "snowFlakeIdGenerator", strategy = "com.airclick.merchant.utils.SnowFlakeIdGenerator")
    private String id;

    @Column(name="user_name", nullable = true, length = 100, columnDefinition = "varchar(64) COMMENT '用户名'")
    @ApiModelProperty("用户名")
    private String userName;

    @Column(name="password", nullable = true, length = 100, columnDefinition = "varchar(64) COMMENT '密码'")
    @ApiModelProperty("密码")
    private String password;

    @Column(name="icon", nullable = true, length = 100, columnDefinition = "varchar(500) COMMENT '头像'")
    @ApiModelProperty("头像")
    private String icon;

    @Column(name="email", nullable = true, length = 100, columnDefinition = "varchar(100) COMMENT '邮箱'")
    @ApiModelProperty("邮箱")
    private String email;

    @Column(name="nick_name", nullable = true, length = 100, columnDefinition = "varchar(200) COMMENT '昵称'")
    @ApiModelProperty("昵称")
    private String nickname;

    @Column(name="note", nullable = true, length = 100, columnDefinition = "varchar(500) COMMENT '备注信息'")
    @ApiModelProperty("备注信息")
    private String note;

    @Column(name="login_time", nullable = true, length = 100, columnDefinition = "datetime COMMENT  '最后登录时间'")
    @ApiModelProperty("最后登录时间")
    private String loginTime;

    @Column(name="status", nullable = true, length = 100, columnDefinition = "int(1) COMMENT '帐号启用状态：0->禁用；1->启用'")
    @ApiModelProperty("帐号启用状态：0->禁用；1->启用")
    private Integer status;

    @Column(name="admin_id", nullable = true, length = 100, columnDefinition = "varchar(64) COMMENT '商户号(总后台的adminId=0)'")
    @ApiModelProperty("商户号(总后台的adminId=0)")
    private String adminId;

    @Column(name="is_super_shop", nullable = true, length = 100, columnDefinition = "int(1) COMMENT '属于什么用户 0商户 = 1运营'")
    @ApiModelProperty("属于什么用户 0商户 = 1运营")
    private Integer isSuperShop;

    @Column(name="delete_state", nullable = true, length = 100, columnDefinition = "int(1) COMMENT '0表示已经删除，1表示没有删除'")
    @ApiModelProperty("0表示已经删除，1表示没有删除")
    private Integer deleteState;

    @Column(name="phone", nullable = true, length = 100, columnDefinition = "varchar(20) COMMENT '电话'")
    @ApiModelProperty("电话")
    private String phone;

    @Transient
    private String merchantName;

    @Transient
    private String merchantCode;

}
